package com.xiangty.springcloud.service;

import org.springframework.stereotype.Component;

/**
 * @Date 2021/5/27
 * @Created by xiangty
 * 实现PaymentHystrixService类的接口，在PaymentHystrixService接口中的@FeignClient注解中，添加fallback方法。如下：
 *      @FeignClient(value = "CLOUD-PROVIDER-HYSTRIX-PAYMENT", fallback = PaymentFallbackService.class)
 * PaymentHystrixService接口远程调用服务出异常或者错误的时候，会默认去查找PaymentFallbackService类中的方法执行。
 */
@Component
public class PaymentFallbackService implements PaymentHystrixService {
    @Override
    public String paymentInfo_OK(Integer id) {
        return "----PaymentFallbackService fall back paymentInfo_OK,o(╥﹏╥)o";
    }

    @Override
    public String paymentInfo_Timeout(Integer id) {
        return "----PaymentFallbackService fall back paymentInfo_Timeout,o(╥﹏╥)o";
    }
}
